home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CLPMOUSE.ARJ / TMOUSE.PRG < prev    next >
Text File  |  1991-06-17  |  1KB  |  47 lines

  1. FUNCTION SMOUSE(mx,my,mx1,my1,mb,mb1)
  2. local DMOUSE, ax, ay, ab, yxb_pos
  3.  
  4. /* This function will return the setting if the conditions are satisfied 
  5.    SYNTAX: MOUSE(n1,n2,n3[,n4,n5,n6])
  6.    
  7.    n1 = Beginning X-coordinate range
  8.    n2 = Beginning Y-coordinate range
  9.    n3 = Beginning Button range
  10.    n4 = Ending X-coordinate range
  11.    n5 = Ending Y-coordinate range
  12.    n6 = Ending Button range
  13.    
  14.    NOTE: If parameters n4-n6 are not used, explicit coordinates are called for.
  15.          ie, MOUSE(10,12,1)         requires that button 1 is pressed with 
  16.                      the mouse on row 10, column 12.
  17.              MOUSE(10,12,1,15,30,3)    requires that any button or both be
  18.                                     pressed with the mouse cursor within
  19.                     rows 10-15, and columns 12-30.       */
  20.  
  21. /* First, call assembler routines */
  22.  
  23. ay = MS_XPOS()
  24. ax = MS_YPOS()
  25. ab = MS_BPOS()
  26.  
  27. yxb_pos = padl(ax,2,"0")+padl(ay,2,"0")+alltrim(str(ab))
  28.  
  29. /* Break it out into elements    */
  30.  
  31. if pcount() > 3
  32.    /* all parameters are used */
  33.    if (ax >= mx) .and. (ay >= my) .and. (ab >= mb)
  34.       if (ax <= mx1) .and. (ay <= my1) .and. (ab <= mb1)
  35.          return(yxb_pos) 
  36.       else
  37.          return(NIL)
  38.       endif
  39.    else
  40.       return(NIL)
  41.    endif
  42. else
  43.    /* only three are used */   
  44.    return(if((ax=mx).and.(ay=my).and.(ab=mb),yxb_pos,NIL))
  45. endif
  46. return(NIL)
  47.